package com.zm.scsimple.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zoum
 * @create 2019/2/22 11:12
 */

@SpringBootApplication
public class GatewayApp {


    public static void main(String[] args){
        SpringApplication.run(GatewayApp.class, args);
    }

    @Bean
    public RouteLocator myRoutes(RouteLocatorBuilder builder) {
        return builder.routes()
//                .route(
//                        p -> p.path("/get")
//                            .filters(f -> f.addRequestHeader("hello", "world"))
//                            .uri("http://httpbin.org:80")
//                )
                .build();
    }
}
